package net.maku.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;

import lombok.extern.slf4j.Slf4j;

@Slf4j
//@Configuration
public class WebMvcConfig extends WebMvcConfigurationSupport {
    /**
     * 设置静态资源映射
     * @param registry
     */
	/*
    @Override
    protected void addResourceHandlers(ResourceHandlerRegistry registry) {
        log.info("开始静态资源映射...");
        registry.addResourceHandler("D:\\workspaces\\workspace20240602\\maku-duxiai\\src\\main\\resources\\static/**") 		// 表示文件路径
        .addResourceLocations("classpath:/static/"); 	// 表示要开放的资源
        //registry.addResourceHandler("/front/**").addResourceLocations("classpath:/front/");
        
    }*/
	
    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler("/res/**").addResourceLocations("file:D:\\workspaces\\workspace20240602\\maku-duxiai\\src\\main\\resources\\static/");
    }
}
